import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import AutoImport from 'unplugin-auto-import/vite';
import { resolve } from 'path';

export default defineConfig({
    plugins: [vue(), AutoImport({ imports: ['vue', 'vue-router'] })],
    resolve: {
        // ↓路径别名
        alias: {
            '@': resolve(__dirname, './src'),
        },
    },
    server: {
        proxy: {
          '/code': {
            target: 'http://10.3.73.177:4200',
            changeOrigin: true,
            // rewrite: (path) => path.replace(/^\/code/, '') // 不可以省略rewrite
          }
        }
      }
    
});
